package net.csdn.business.notify.common.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;
import net.csdn.business.notify.common.pipeline.model.ContentModel;
import net.csdn.business.notify.common.pipeline.model.EmailContentModel;
import net.csdn.business.notify.common.pipeline.model.ImContentModel;
import net.csdn.business.notify.common.pipeline.model.SmsContentModel;

import java.util.Arrays;
import java.util.Objects;

/**
 * @ClassName ChannelType
 * @Description 通知业务类型枚举
 * @Author zhangyl
 * @Date 2023/11/29 17:55
 */
@Getter
@ToString
@AllArgsConstructor
public enum NotifyType {


    /**
     * 通知类业务
     */
    REMIND(1, "通知类业务","remind"),
    /**
     * 私信类业务
     */
    PRIVATE(2, "私信类业务","private"),

    /**
     * 营销类直达用户账号的通知
     */
    DIRECT(3, "直达业务","direct"),

    ;

    /**
     * 编码值
     */
    private final Integer code;

    /**
     * 描述
     */
    private final String desc;

    /**
     * 英文标识
     */
    private final String codeEn;


    public static String ofCodeEn(Integer code) {
        for (NotifyType type : NotifyType.values()) {
            if (type.code.equals(code)) {
                return type.codeEn;
            }
        }
        throw new IllegalArgumentException("NotifyType get codeEn param error");
    }

}
